package cn.xuchunh.campusbbs.adapter;

import android.content.Context;
import android.net.Uri;
import android.view.View;
import android.view.ViewGroup;

import cn.xuchunh.campusbbs.R;
import cn.xuchunh.campusbbs.base.BaseRecyclerViewAdapter;
import cn.xuchunh.campusbbs.bean.Album;
import cn.xuchunh.campusbbs.viewholder.AlbumViewHolder;

/**
 * Created by XuChunH on 2015/10/22.
 */
public class AlbumListAdapter extends BaseRecyclerViewAdapter<AlbumViewHolder, Album> {
    public AlbumListAdapter(Context context) {
        super(context);
        setNeedFooter(true);
    }

    @Override
    public AlbumViewHolder onCreateContentViewHolder(ViewGroup parent, int viewType) {
        return new AlbumViewHolder(inflater.inflate(R.layout.item_album_list, parent, false), parent);
    }

    @Override
    protected void onBindContentViewHolder(AlbumViewHolder holder, int position) {
        Album album = getItem(position);
        Uri uri = Uri.parse(album.getIcon());
        holder.bindContent(uri,album.getTitle());
    }


}
